<ul class="nav nav-tabs">
	<li ng-repeat="tab in pagedata.tabs" ng-class="{'active':pagedata.params.type==tab.type}"><a href="javascript:;" ng-click="access_json('/account.content/list/type='+tab.type)">{{tab.title}}</a></li>
</ul>
<div class="keyword-list-head" ng-if="pagedata.op !='add' && pagedata.op !='get'">
	<div class="keyword-list-head clearfix">
		<div class="input-group jinyun-margin-bottom" style="width:466px;">
			<div class="input-group-btn" style="font-size:14px">
				<select ng-model="pagedata.params.group_id" class="jinyun-select mass-group">
					<option value="" ng-selected="true">全部</option>
					<option ng-repeat="v in pagedata.groups" value="{{v.id}}" ng-selected="v.id==pagedata.params.group_id">{{v.title}}</option>
				</select>
			</div>
			<input class="form-control" type="text" ng-model="pagedata.params.title" value="" placeholder="" style="width: 430px;">
			<span class="input-group-btn"><button id="submit" ng-click="pagedata.params.page=1;access(pagedata.op,made_query(pagedata.params))" class="btn btn-default"><i class="fa fa-search"></i></button></span>
			<span class="input-group-btn" style="padding-left:60px"><a href="javascript:;" ng-click="access('edit')" class="btn btn-primary">+添加{{pagedata.content_types[pagedata.params.type]}}</a></span>
		</div>
	</div>
</div>
<!--文本-->
<div class="img_pick_panel" ng-if="pagedata.params.type=='text'">
  <div class="inner_container_box side_r cell_layout">
    <div class="inner_main">
      <div class="bd">
        <div class="media_list">
          <div class="group img_pick" id="js_imglist">
            <ul class="group">
              <li class="img_item js_imgitem" ng-repeat="item in pagedata.list">
                <div class="img_item_bd">
                  <span class="js_img_icon pic cover" style="height:68px;padding:6px;text-align: left;">
				  {{item.content}}
				  </span>
                  <span class="check_content bold" style="padding:0 6px;text-align: left;">
                     {{item.title}}
                  </span>
                </div>
                <div class="msg_card_ft">
                  <ul class="grid_line msg_card_opr_list">
                    <li class="grid_item size-1of2 msg_card_opr_item">
                      <a class="js_edit js_tooltip js_popover" ng-click="access_json('/account.content/edit/id='+item.id)" title="管理图文">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-pencil ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                    <li class="grid_item size-1of2 no_extra msg_card_opr_item">
                      <a class="js_del js_tooltip" ng-click="post({},'del','id='+item.id)" title="删除">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-trash-o ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                  </ul>
                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!--图文-->
<div class="img_pick_panel" ng-if="pagedata.params.type=='news' || pagedata.params.type=='miniprogram'">
  <div class="inner_container_box side_r cell_layout">
    <div class="inner_main">
      <div class="bd">
        <div class="media_list">
          <div class="group img_pick" id="js_imglist">
            <ul class="group">
              <li class="img_item js_imgitem" ng-repeat="item in pagedata.list">
                <div class="img_item_bd">
                  <span class="js_img_icon pic cover" style="background-image:url({{tomedia(item.image) || '../core/resource/images/nopic.jpg'}})"></span>
                  <span class="check_content bold" style="text-align:left;padding:0 6px">
                    <label class="frm_checkbox_label">
                      <span class="lbl_content" style="width:160px">{{item.title}}</span>
					</label>
                  </span>
                </div>
                <div class="msg_card_ft">
                  <ul class="grid_line msg_card_opr_list">
                    <li class="grid_item size-1of3 msg_card_opr_item">
                      <a class="js_edit js_tooltip js_popover" ng-click="access_json('/account.content/edit/id='+item.id)" title="管理图文">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-pencil ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                    <li class="grid_item size-1of3 no_extra msg_card_opr_item">
                      <a class="js_del js_tooltip" ng-click="post({},'del','id='+item.id)" title="删除">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-trash-o ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                  </ul>
                </div>
              </li>
         
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!--图片-->
<div class="img_pick_panel" ng-if="pagedata.params.type=='image'">
  <div class="inner_container_box side_r cell_layout">
    <div class="inner_main">
      <div class="bd">
        <div class="media_list">
          <div class="oper_group group">
            <div class="frm_controls oper_ele l">
              <label class="frm_checkbox_label" for="js_all">
                <input id="js_all" type="checkbox" style="margin-top:-4px;" data-label=" 全选" onclick="var ck = this.checked;$(':checkbox').each(function(){if(this.checked != ck){$(this).click();}});">
                <span class="lbl_content" >&nbsp;全选</span></label>
            </div>           
            <a href="javascript:;"  class="btn btn-default oper_ele l js_popover" ng-click="post({},'del','del='+pagedata.del,'','确认删除这几个图片素材？')" >删除</a>
		  </div>
		  <div class="group img_pick" id="js_imglist">
            <ul class="group">
              <li class="img_item js_imgitem" ng-repeat="image in pagedata.list">
                <div class="img_item_bd">
                  <span class="js_img_icon pic cover" style="background-image:url({{tomedia(image.image) || '../core/resource/images/nopic.jpg'}})"></span>
                  <span class="check_content bold" style="text-align:left;padding:0 6px">
                    <label class="frm_checkbox_label">
                       <input type="checkbox" style="margin-top:-24px;" ng-click="duoxuans(image.id,pagedata,'del')">
					  <span class="lbl_content">{{image.title}}</span>
					</label>
                  </span>
                </div>
                <div class="msg_card_ft">
                  <ul class="grid_line msg_card_opr_list">
                    <li class="grid_item size-1of3 msg_card_opr_item">		
                      <a ng-if="item.lookcontent && item.lookcontent[0]" class="js_edit js_tooltip js_popover" ng-click="access_json('/account.content/edit/id='+item.id)" title="编辑名称">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-pencil ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
					  <a ng-if="!item.lookcontent || !item.lookcontent[0]" class="js_edit js_tooltip js_popover" ng-click="getmodal('wechat.media','ctitle','id='+image.id)" title="编辑名称">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-pencil ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                    <li class="grid_item size-1of3 no_extra msg_card_opr_item">
                      <a class="js_del js_tooltip" ng-click="post({},'del','id='+image.id)" title="删除">
                        <span class="msg_card_opr_item_inner">
                          <i class="fa fa-trash-o ico-add"></i></span>
                        <span class="vm_box"></span>
                      </a>
                    </li>
                  </ul>
                </div>
              </li>
         
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="media_list group voice_media" ng-if="pagedata.params.type=='audio'">
  <div class="msg_card audio_msg_card media_card mini no_opr_border" ng-repeat="voice in pagedata.list">
    <div class="msg_card_inner">
      <div class="msg_card_bd">
        <div  class="audio_msg_wrp card file_wrp cover">
          <div class="audio_msg">
            <div class="icon_audio_wrp l" data-attach="{{tomedia(voice.file)}}">
              <span class="icon_audio_msg"> <img src="/core/resource/images/ico-audio.png" width="60px"></img></span>
            </div>
            <div class="audio_content">
              <div class="audio_title">{{voice.title}}</div>
              <div class="audio_date">{{date(voice.createtime)}}</div>
			  </div>
          </div>
        </div>
      </div>
      <div class="msg_card_ft">
        <ul class="grid_line msg_card_opr_list">
          <li class="grid_item size-1of3 msg_card_opr_item">
            <a class="js_tooltip" href="{{tomedia(voice.file)}}" target="_blank" title="下载">
              <span class="msg_card_opr_item_inner">
                <i class="fa fa-download ico-add"></i></span>
              <span class="vm_box"></span>
            </a>
          </li>
          <li class="grid_item size-1of3 msg_card_opr_item">
            <a class="js_edit js_tooltip" id="{{voice.id}}" href="javascript:;" ng-click="pagedata.play_audio('',voice.id)" title="播放">
              <span class="msg_card_opr_item_inner">
                <i class="fa fa-play-circle-o {{voice.ispay!=1?'ico-add':'ico-pause'}}"></i>
				</span>
              <span class="vm_box"></span>
            </a>
			<audio id="id{{voice.id}}" style="display:none;" src="{{tomedia(voice.file)}}" loop="loop"></audio>
          </li>
          <li class="grid_item size-1of3 no_extra msg_card_opr_item">
            <a class="js_del js_tooltip" href="javascript:;" ng-click="post({},'del','id='+voice.id,'','确认删除这个素材？')" title="删除">
              <span class="msg_card_opr_item_inner">
                <i class="fa fa-trash-o ico-add"></i></span>
              <span class="vm_box"></span>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>
<div class="media_list group voice_media" ng-if="pagedata.params.type=='video'">
  <div class="msg_card audio_msg_card media_card mini no_opr_border" ng-repeat="item in pagedata.list">
    <div class="msg_card_inner">
      <div class="msg_card_bd">
        <div  class="audio_msg_wrp card file_wrp cover">
          <div class="audio_msg">
            <div class="icon_audio_wrp l" data-attach="{{tomedia(item.file)}}">
			  <video src="{{tomedia(item.file)}}" width="150" height="120" controls="controls"></video>
            </div>
            <div class="audio_content" style="padding-left:10px">
              <div class="audio_title">{{item.title}}</div>
			  <div class="audio_date">{{date(item.createtime)}}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="msg_card_ft">
        <ul class="grid_line msg_card_opr_list">        
          <li class="grid_item size-1of3 no_extra msg_card_opr_item">
            <a class="js_del js_tooltip" href="javascript:;" ng-click="post({},'del','id='+item.id,'','确认删除这个素材？')" title="删除">
              <span class="msg_card_opr_item_inner">
                <i class="fa fa-trash-o ico-add"></i></span>
              <span class="vm_box"></span>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>
<script>
scope.pagedata.selectEmoji=function(){
	var res=function(emoji){
		scope.pagedata.item.lookcontent+=emoji;
	}
	scope.modal_func(res,'','tools.emoji','','core');
}
scope.unitfunc.choose_many=function(tovalue,field,url){
		if(url.indexOf('/')<0){
			url='/'+url;
		}
		scope.modal_func(function(res){
			if(!Array.isArray(tovalue[field])){
				tovalue[field]=[];
				tovalue[field].push(res);
			}else{
				var has=false;
				tovalue[field].forEach(function(item){
					if(JSON.stringify(item)==JSON.stringify(res)){
						has=true;
					}
				});
				if(!has){
					tovalue[field].push(res);
				}
			}
		},'',url);
}
scope.pagedata.upimage=function(choose_type){
	scope.images(scope.pagedata.item,'lookcontent');
}
scope.pagedata.upaudio=function(choose_type){
	scope.choose_source(scope.pagedata.item,'lookcontent','audio');
}
scope.pagedata.upvideo=function(choose_type){
	scope.choose_source(scope.pagedata.item,'lookcontent','video');
}
</script>
</div>